<h1>演示自己封装的工具库</h1>

<h1>一、日期格式化</h1>
<script src="./utils.js"></script>
<script>
  timeFormat("2021-11-26 11:49:34")
</script>

<h1>二、判断是什么类型的浏览器</h1>
<script src="./utils.js"></script>
<script>
  console.log(userAgent)
</script>

<h1>三、判断是pc还是移动端</h1>

<script src="./utils.js"></script>
<script>
  document.write("是否PC:" + isPC() + "<br/>是否移动端:" + isMobile() + "<br/>是否微信:" + isWeChat());
</script>

<h1>四、图片懒加载</h1>

<img src="./images/dongtu.gif" Raw-data="./images/1.jpeg" height="600" alt=""></br>
<img src="./images/dongtu.gif" Raw-data="./images/2.jpeg" height="600" alt=""></br>
<img src="./images/dongtu.gif" Raw-data="./images/3.jpeg" height="200" alt=""></br>
<img src="./images/dongtu.gif" Raw-data="./images/4.jpeg" height="500" alt=""></br>
<img src="./images/dongtu.gif" Raw-data="./images/5.jpeg" height="300" alt="">

<script src='./图片懒加载.js'></script>

<h1>json数据格式转换</h1>
<script src='./json.js'></script>

<h1>六、数据请求get和post方法</h1>
<div class="box">
  <h1>百度搜索框</h1>
  <input type="text">
  <ul></ul>

</div>

<div class="box2">
  <h2>创建角色</h2>
  <textarea name="" id="" cols="30" rows="10"></textarea><br>
  <button>点击创建</button>
</div>
<script src="./ajax.js"></script>


<h1>cookie存取数据封装</h1>
<script src="./cookie.js"></script>
<script>
  setItem('uname', '哈哈哈', 6)

  console.log(getItem('uname'))
  removeItem('uname')
  console.log(getItem('uname'))
    // setTimeout(()=>{
    //     removeItem('uname')
    // },6000)
</script>